import request from '@/router/axios'

// 客户添加/流失基础信息
export function getChannelBasicInfo(params) {
    return request({
        url: '/cp/channelcodecontact/details',
        method: 'get',
        params,
    })
}

// 客户echarts统计
export function getChannelEchartsInfo(params) {
    return request({
        url: '/cp/channelcodecontact/chart',
        method: 'get',
        params,
    })
}

// 按日期查询客户统计列表
export function getChannelInfoByDate(params) {
    return request({
        url: '/cp/channelcodecontact/table-date',
        method: 'get',
        params,
    })
}

// 按日期查询客户统计列表下载
export function downloadChannelInfoByDate(data) {
    return request({
        url: '/cp/channelcodecontact/table-date-excel',
        method: 'post',
        data,
        responseType: 'blob'
    })
}

// 按日期查询客户统计详情
export function getChannelDetailByDate(params) {
    return request({
        url: '/cp/channelcodecontact/table-date-details',
        method: 'get',
        params,
    })
}

// 按日期查询客户统计详情下载
export function downloadChannelDetailByDate(data) {
    return request({
        url: '/cp/channelcodecontact/table-date-details-excel',
        method: 'post',
        data,
        responseType: 'blob'
    })
}

// 按员工查询客户统计列表
export function getChannelInfoByStaff(params) {
    return request({
        url: '/cp/channelcodecontact/table-employee',
        method: 'get',
        params,
    })
}

// 按员工查询客户统计下载
export function downloadChannelInfoByStaff(data) {
    return request({
        url: '/cp/channelcodecontact/table-employee-excel',
        method: 'post',
        data,
        responseType: 'blob'
    })
}

// 按员工查询客户统计详情
export function getChannelDetailByStaff(params) {
    return request({
        url: '/cp/channelcodecontact/table-employee-details',
        method: 'get',
        params,
    })
}

// 按员工查询客户统计详情下载
export function downloadChannelDetailByStaff(data) {
    return request({
        url: '/cp/channelcodecontact/table-employee-details-excel',
        method: 'post',
        data,
        responseType: 'blob'
    })
}

// 多渠道活码表格对比数据
export function compareCodeOrGroupTable(params) {
    return request({
        url: '/cp/channelcodecontact/contrast-details',
        method: 'get',
        params,
    })
}

// 多渠道活码表格对比数据下载
export function downloadcompareCodeOrGroup(data) {
    return request({
        url: '/cp/channelcodecontact/contrast-details-excel',
        method: 'post',
        data,
        responseType: 'blob'
    })
}

// 多渠道活码趋势图对比数据下载
export function compareCodeOrGroupEchart(params) {
    return request({
        url: '/cp/channelcodecontact/contrast-line-chart',
        method: 'get',
        params,
    })
}
